cmake_minimum_required(VERSION 3.0)

include_directories(include)
aux_source_directory(SnakerPlayer SnakerPlayer_d)
aux_source_directory(SnakerFruit SnakerFruit_d)
aux_source_directory(SnakerMap SnakerMap_d)
aux_source_directory(SnakerUtils SnakerUtils_d)
aux_source_directory(RetroSnake RetroSnake_d)

add_library(SnakerPlayer SHARED ${SnakerPlayer_d})
add_library(SnakerFruit SHARED ${SnakerFruit_d})
add_library(SnakerMap SHARED ${SnakerMap_d})
add_library(SnakerUtils SHARED ${SnakerUtils_d})
add_library(pdcurses SHARED IMPORTED)
set_target_properties(pdcurses PROPERTIES IMPORTED_LOCATION /lib/x86_64-linux-gnu/libncurses)

target_link_libraries(SnakerPlayer SnakerMap)
target_link_libraries(SnakerFruit SnakerUtils)
target_link_libraries(SnakerMap SnakerFruit)

add_executable(RetroSnake ${RetroSnake_d})
target_link_libraries(RetroSnake SnakerPlayer -lncurses)

install(TARGETS RetroSnake SnakerPlayer SnakerFruit SnakerMap SnakerUtils RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/build/bin)
# install(FILES ${PROJECT_SOURCE_DIR}/lib/pdcurses.dll DESTINATION ${PROJECT_SOURCE_DIR}/build/bin)